package com.zxmzy.scaffold.project

import com.google.gson.annotations.SerializedName
import com.zxmzy.scaffold.core.net.BaseResult
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST

/**
 * @author zhangxiaoming
 * @date 2023/8/25
 * @description
 */
data class Banner(
    val desc: String,
    val id: Int,
    val imagePath: String,
    val isVisible: Int,
    val order: Int,
    val title: String,
    val type: Int,
    val url: String
)

class WanResponse<T>:BaseResult<T>(){
    @SerializedName("errorCode")
    override var code: Int = 0

    @SerializedName("errorMsg")
    override var msg: String = ""
}

data class LoginParam(val username: String, val password: String)
interface TestService {
    @GET("/banner/json")
    suspend fun getBanner(): WanResponse<List<Banner>>

    @POST("/user/login")
    suspend fun login(@Body param: LoginParam):WanResponse<String>
}